﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Delphi.Mimir.Data.Entities.Final {
    public class Account {
        public Account() {
            Transactions = new List<Transaction>();
        }
        public int AccountId { set; get; }
        public int PortfolioId { set; get; }
        public Portfolio Portfolio { set; get; }
        ICollection<Transaction> Transactions { set; get; }
        public Decimal Balance {
            get {
                return Transactions.Sum(a => a.AmountReferenceCurrency + a.FeesReferenceCurrency);
            }
        }
        public int CurrencyId { set; get; }
        public Currency Currency { set; get; }
    }
}
